<?php
	//includes
	require_once 'includes.php';

	//COOKIE: yandexmarket = 100,,1,USD,1,,2,0,0,

	//crawl Mobile Phones URLs
	echo "--- Mobile Phones ---<br />";
	echo "<a href = '/yandex/crawlurls.php?page_from=1&page_to=2&cat=mphone&sort=recent'>Crawl recent products URLs (0-20)</a><br />";
	echo "<a href = '/yandex/crawlurls.php?page_from=1&page_to=100&cat=mphone&sort=recent'>Crawl recent products URLs (0-1000)</a><br />";
	echo "<a href = '/yandex/crawlurls.php?page_from=101&page_to=200&cat=mphone&sort=recent'>Crawl recent products URLs (1000-2000)</a><br />";
	echo '<br />';
	echo "<a href = '/yandex/crawlurls.php?page_from=1&page_to=2&cat=mphone&sort=popular'>Crawl popular products URLs (0-20)</a><br />";
	echo "<a href = '/yandex/crawlurls.php?page_from=1&page_to=100&cat=mphone&sort=popular'>Crawl popular products URLs (0-1000)</a><br />";
	echo "<a href = '/yandex/crawlurls.php?page_from=101&page_to=200&cat=mphone&sort=popular'>Crawl popular products URLs (1000-2000)</a><br />";
	echo '<br /><br />';
	
	//crawl Lenses URLs
	echo "--- Lenses ---<br />";
	echo "<a href = '/yandex/crawlurls.php?page_from=1&page_to=2&cat=lense&sort=recent'>Crawl recent products URLs (0-20)</a><br />";
	echo "<a href = '/yandex/crawlurls.php?page_from=1&page_to=100&cat=lense&sort=recent'>Crawl recent products URLs (0-1000)</a><br />";
	echo "<a href = '/yandex/crawlurls.php?page_from=101&page_to=200&cat=lense&sort=recent'>Crawl recent products URLs (1000-2000)</a><br />";
	echo '<br />';
	echo "<a href = '/yandex/crawlurls.php?page_from=1&page_to=2&cat=lense&sort=popular'>Crawl popular products URLs (0-20)</a><br />";
	echo "<a href = '/yandex/crawlurls.php?page_from=1&page_to=100&cat=lense&sort=popular'>Crawl popular products URLs (0-1000)</a><br />";
	echo "<a href = '/yandex/crawlurls.php?page_from=101&page_to=200&cat=lense&sort=popular'>Crawl popular products URLs (1000-2000)</a><br />";
	echo '<br /><br />';
	
	//crawl TV URLs
	echo "--- TVs ---<br />";
	echo "<a href = '/yandex/crawlurls.php?page_from=1&page_to=2&cat=tv&sort=recent'>Crawl recent products URLs (0-20)</a><br />";
	echo "<a href = '/yandex/crawlurls.php?page_from=1&page_to=100&cat=tv&sort=recent'>Crawl recent products URLs (0-1000)</a><br />";
	echo "<a href = '/yandex/crawlurls.php?page_from=101&page_to=200&cat=tv&sort=recent'>Crawl recent products URLs (1000-2000)</a><br />";
	echo '<br />';
	echo "<a href = '/yandex/crawlurls.php?page_from=1&page_to=2&cat=tv&sort=popular'>Crawl popular products URLs (0-20)</a><br />";
	echo "<a href = '/yandex/crawlurls.php?page_from=1&page_to=100&cat=tv&sort=popular'>Crawl popular products URLs (0-1000)</a><br />";
	echo "<a href = '/yandex/crawlurls.php?page_from=101&page_to=200&cat=tv&sort=popular'>Crawl popular products URLs (1000-2000)</a><br />";
	echo '<br /><br />';
	
	//crawl Digital Cameras URLs
	echo "--- Digital Cameras ---<br />";
	echo "<a href = '/yandex/crawlurls.php?page_from=1&page_to=2&cat=digital_camera&sort=recent'>Crawl recent products URLs (0-20)</a><br />";
	echo "<a href = '/yandex/crawlurls.php?page_from=1&page_to=100&cat=digital_camera&sort=recent'>Crawl recent products URLs (0-1000)</a><br />";
	echo "<a href = '/yandex/crawlurls.php?page_from=101&page_to=200&cat=digital_camera&sort=recent'>Crawl recent products URLs (1000-2000)</a><br />";
	echo '<br />';
	echo "<a href = '/yandex/crawlurls.php?page_from=1&page_to=2&cat=digital_camera&sort=popular'>Crawl popular products URLs (0-20)</a><br />";
	echo "<a href = '/yandex/crawlurls.php?page_from=1&page_to=100&cat=digital_camera&sort=popular'>Crawl popular products URLs (0-1000)</a><br />";
	echo "<a href = '/yandex/crawlurls.php?page_from=101&page_to=200&cat=digital_camera&sort=popular'>Crawl popular products URLs (1000-2000)</a><br />";
	echo '<br /><br />';	
	
	//crawl Flash URLs
	echo "--- Flashes ---<br />";
	echo "<a href = '/yandex/crawlurls.php?page_from=1&page_to=2&cat=flash&sort=recent'>Crawl recent products URLs (0-20)</a><br />";
	echo "<a href = '/yandex/crawlurls.php?page_from=1&page_to=100&cat=flash&sort=recent'>Crawl recent products URLs (0-1000)</a><br />";
	echo "<a href = '/yandex/crawlurls.php?page_from=101&page_to=200&cat=flash&sort=recent'>Crawl recent products URLs (1000-2000)</a><br />";
	echo '<br />';
	echo "<a href = '/yandex/crawlurls.php?page_from=1&page_to=2&cat=flash&sort=popular'>Crawl popular products URLs (0-20)</a><br />";
	echo "<a href = '/yandex/crawlurls.php?page_from=1&page_to=100&cat=flash&sort=popular'>Crawl popular products URLs (0-1000)</a><br />";
	echo "<a href = '/yandex/crawlurls.php?page_from=101&page_to=200&cat=flash&sort=popular'>Crawl popular products URLs (1000-2000)</a><br />";
	echo '<br /><br />';	
	
	//crawl products
	echo "--- PRODUCTS ---<br />";
	echo "<a href = '/yandex/crawlproducts.php?from=0&quantity=1'>Crawl Products (0-1)</a><br />";
	echo "<a href = '/yandex/crawlproducts.php?from=0&quantity=10'>Crawl Products (0-10)</a><br />";
	echo "<a href = '/yandex/crawlproducts.php?from=0&quantity=1000'>Crawl Products (0-1000)</a><br />";
	echo "<a href = '/yandex/crawlproducts.php?from=1000&quantity=1000'>Crawl Products (1000-2000)</a><br />";
	echo "<a href = '/yandex/crawlproducts.php?from=2000&quantity=1000'>Crawl Products (2000-3000)</a><br />";
	echo "<a href = '/yandex/crawlproducts.php?from=3000&quantity=1000'>Crawl Products (3000-4000)</a><br />";
	echo "<a href = '/yandex/crawlproducts.php?from=4000&quantity=1000'>Crawl Products (4000-5000)</a><br />";
	echo "<a href = '/yandex/crawlproducts.php?from=5000&quantity=1000'>Crawl Products (5000-6000)</a><br />";
	echo "<a href = '/yandex/crawlproducts.php?from=6000&quantity=1000'>Crawl Products (6000-7000)</a><br />";
	echo "<a href = '/yandex/crawlproducts.php?from=7000&quantity=1000'>Crawl Products (7000-8000)</a><br />";
	echo "<a href = '/yandex/crawlproducts.php?from=8000&quantity=1000'>Crawl Products (8000-9000)</a><br />";
	echo "<a href = '/yandex/crawlproducts.php?from=9000&quantity=1000'>Crawl Products (9000-10000)</a><br />";
	echo '<br /><br />';

	//crawl products details
	echo "--- PRODUCTS DETAILS ---<br />";
	echo "<a href = '/yandex/crawlproductsdetails.php?from=0&quantity=1'>Crawl Products Details (0-1)</a><br />";
	echo "<a href = '/yandex/crawlproductsdetails.php?from=0&quantity=10'>Crawl Products Details (0-10)</a><br />";
	echo "<a href = '/yandex/crawlproductsdetails.php?from=0&quantity=1000'>Crawl Products Details (0-1000)</a><br />";
	echo "<a href = '/yandex/crawlproductsdetails.php?from=1000&quantity=1000'>Crawl Products Details (1000-2000)</a><br />";
	echo "<a href = '/yandex/crawlproductsdetails.php?from=2000&quantity=1000'>Crawl Products Details (2000-3000)</a><br />";
	echo "<a href = '/yandex/crawlproductsdetails.php?from=3000&quantity=1000'>Crawl Products Details (3000-4000)</a><br />";
	echo "<a href = '/yandex/crawlproductsdetails.php?from=4000&quantity=1000'>Crawl Products Details (4000-5000)</a><br />";
	echo "<a href = '/yandex/crawlproductsdetails.php?from=5000&quantity=1000'>Crawl Products Details (5000-6000)</a><br />";
	echo "<a href = '/yandex/crawlproductsdetails.php?from=6000&quantity=1000'>Crawl Products Details (6000-7000)</a><br />";
	echo "<a href = '/yandex/crawlproductsdetails.php?from=7000&quantity=1000'>Crawl Products Details (7000-8000)</a><br />";
	echo "<a href = '/yandex/crawlproductsdetails.php?from=8000&quantity=1000'>Crawl Products Details (8000-9000)</a><br />";
	echo "<a href = '/yandex/crawlproductsdetails.php?from=9000&quantity=1000'>Crawl Products Details (9000-10000)</a><br />";
	echo '<br /><br />';	
	
	
	
//	http://market.yandex.ru/guru.xml?CMD=-RR=9,0,0,0-VIS=211E2-CAT_ID=108206-EXC=1-PG=10&hid=90639&filter=&num=&greed_mode=false
//	http://market.yandex.ru/guru.xml?CMD=-RR=9,0,0,0-VIS=19E2-CAT_ID=108206-EXC=1-PG=10&hid=90639&filter=&num=&greed_mode=false	
	
//	$baseUrl = 'http://market.yandex.ru/guru.xml?hid=90639&CMD=-RR=9,0,0,0-VIS=201E2-CAT_ID=108206-BPOS=*0-EXC=1-PG=10';
//	$urls = array();
//	$items = array();
//	
//	for ($i = 0; $i < 2; $i++)
//	{
//		$page = phpQuery::newDocumentFileHTML(str_replace('*', $i, $baseUrl));
//		
//		$results = $page->find(".b-offers__name");
//		foreach ($results as $result)
//		{
//			$urls[] = 'http://market.yandex.ru/'.pq($result)->attr('href');
//		}			
//	}
//	
//	foreach ($urls as $count => $url)
//	{
//		$page = phpQuery::newDocumentFileHTML($url);
//		$items[$count] = $page->find(".b-page-title_type_model")->html();
//		echo '#'.$count.': '.$items[$count].'<br />';
//	}
//	Utils::VarDump($urls);
//	Utils::VarDump($items);
?>